JavaScriptオブジェクト指向プログラミング  例題一覧

JavaScript Object-Oriented Programming (JSOOP)

In JavaScript, almost "everything" is an object. In JavaScript, objects are king. If you understand objects, you understand JavaScript.
Object Definition

In JavaScript, almost "everything" is an object,except primitives.A primitive value is a value that has no properties or methods.

変数宣言の特徴
let const var
再代入
再宣言
ブロックスコープ
関数スコープ
Object Properties

Properties are the values associated with a JavaScript object. A JavaScript object is a collection of unordered properties. Properties can usually be changed, added, and deleted, but some are read only.

Object Methods

JavaScript methods are actions that can be performed on objects. A JavaScript method is a property containing a function definition.

Display Objects
Some common solutions to display JavaScript objects are: displaying
  1. the Object Properties by name
  2. the Object Properties in a Loop
  3. the Object using Object.values()
  4. the Object using JSON.stringify()
Accessors(Getters and Setters)

Getters and setters allow you to define Object Accessors (Computed Properties).

object constructor function

Objects of the same type are created by calling the constructor function with the new keyword:

Prototypes
The JavaScript prototype property allows you to add new properties and add new methods to object constructors:
Iterables

Iterable objects are objects that can be iterated over with for..of. Technically, iterables must implement the Symbol.iterator method.

Sets

A JavaScript Set is a collection of unique values. Each value can only occur once in a Set. A Set can hold any value of any data type.

Maps
A Map holds key-value pairs where the keys can be any datatype. A Map remembers the original insertion order of the keys. A Map has a property that represents the size of the map.
Class

JavaScript Classes are templates for JavaScript Objects.

Async

To define the executing sequence of fuctions by following techniques.

プログラムポートフォリオ (Program Portfolio)

JavaScript Object Oriented Programming